Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-412

Ambiguous syntax between namespace function call and map object definition.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.3
    • 3.4.0
    • None

    Description

      function test() {
        return 'x';
      }
      
      let var1 = 'var1';
      let x = {
        var1: test(),
        'var2': 1
      } 

      this code caused a parse error.

      Looks like the reason is the parser consider `var1: test()` as a namespace function call but here I just want define a map keyed by variable.

      Is it possible to disable 'namespace' feature to avoid this ambiguous syntax?

      Thanks!

      Attachments

        Activity

          People

            henrib Henri Biestro
            xupengcheng Xu Pengcheng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: